<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>安装 | 欢迎学习Redis课程</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../redis/pei-zhi.html" />
    
    
    <link rel="prev" href="../redis.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="1.1"
        data-chapter-title="安装"
        data-filepath="redis/an-zhuang.md"
        data-basepath=".."
        data-revision="Sun Apr 15 2018 01:48:52 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        课程介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="redis.html">
            
                
                    <a href="../redis.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        Redis
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.1" data-path="redis/an-zhuang.html">
            
                
                    <a href="../redis/an-zhuang.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="redis/pei-zhi.html">
            
                
                    <a href="../redis/pei-zhi.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        配置
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="redis/fu-wu-duan-he-ke-hu-duan-ming-ling.html">
            
                
                    <a href="../redis/fu-wu-duan-he-ke-hu-duan-ming-ling.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        服务端和客户端命令
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="redis/shu-ju-cao-zuo.html">
            
                
                    <a href="../redis/shu-ju-cao-zuo.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        数据操作
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="redis/shu-ju-cao-zuo/string.html">
            
                
                    <a href="../redis/shu-ju-cao-zuo/string.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.1.</b>
                        
                        string
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="redis/shu-ju-cao-zuo/jian-ming-ling.html">
            
                
                    <a href="../redis/shu-ju-cao-zuo/jian-ming-ling.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.2.</b>
                        
                        键命令
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="redis/shu-ju-cao-zuo/hash.html">
            
                
                    <a href="../redis/shu-ju-cao-zuo/hash.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.3.</b>
                        
                        hash
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="redis/shu-ju-cao-zuo/list.html">
            
                
                    <a href="../redis/shu-ju-cao-zuo/list.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.4.</b>
                        
                        list
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="redis/shu-ju-cao-zuo/set.html">
            
                
                    <a href="../redis/shu-ju-cao-zuo/set.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.5.</b>
                        
                        set
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="redis/shu-ju-cao-zuo/zset.html">
            
                
                    <a href="../redis/shu-ju-cao-zuo/zset.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.6.</b>
                        
                        zset
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="redis/yu-python-jiao-hu.html">
            
                
                    <a href="../redis/yu-python-jiao-hu.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        与Python交互
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="redis/yu-python-jiao-hu/strictredis.html">
            
                
                    <a href="../redis/yu-python-jiao-hu/strictredis.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.1.</b>
                        
                        StrictRedis
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="redis/yu-python-jiao-hu/string.html">
            
                
                    <a href="../redis/yu-python-jiao-hu/string.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.2.</b>
                        
                        string
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="redis/da-jian-zhu-cong.html">
            
                
                    <a href="../redis/da-jian-zhu-cong.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        搭建主从
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="redis/da-jian-ji-qun.html">
            
                
                    <a href="../redis/da-jian-ji-qun.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        搭建集群
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="redis/da-jian-ji-qun/pei-zhi-ji-qi-1.html">
            
                
                    <a href="../redis/da-jian-ji-qun/pei-zhi-ji-qi-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.1.</b>
                        
                        配置机器1
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="redis/da-jian-ji-qun/pei-zhi-ji-qi-2.html">
            
                
                    <a href="../redis/da-jian-ji-qun/pei-zhi-ji-qi-2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.2.</b>
                        
                        配置机器2
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="redis/da-jian-ji-qun/chuang-jian-ji-qun.html">
            
                
                    <a href="../redis/da-jian-ji-qun/chuang-jian-ji-qun.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.3.</b>
                        
                        创建集群
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="redis/da-jian-ji-qun/yu-python-jiao-hu.html">
            
                
                    <a href="../redis/da-jian-ji-qun/yu-python-jiao-hu.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.4.</b>
                        
                        与Python交互
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >欢迎学习Redis课程</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="redis-&#x5B89;&#x88C5;">Redis &#x5B89;&#x88C5;</h1>
<ul>
<li>&#x5F53;&#x524D;redis&#x6700;&#x65B0;&#x7A33;&#x5B9A;&#x7248;&#x672C;&#x662F;4.0.9</li>
<li>&#x5F53;&#x524D;ubuntu&#x865A;&#x62DF;&#x673A;&#x4E2D;&#x5DF2;&#x7ECF;&#x5B89;&#x88C5;&#x597D;&#x4E86;redis&#xFF0C;&#x4EE5;&#x4E0B;&#x6B65;&#x9AA4;&#x53EF;&#x4EE5;&#x8DF3;&#x8FC7; &#x6700;&#x65B0;&#x7A33;&#x5B9A;&#x7248;&#x672C;&#x4E0B;&#x8F7D;&#x94FE;&#x63A5;&#xFF1A;
<a href="http://download.redis.io/releases/redis-4.0.9.tar.gz" target="_blank">http://download.redis.io/releases/redis-4.0.9.tar.gz</a></li>
<li><p>step1:&#x4E0B;&#x8F7D;</p>
<blockquote>
<p>wget <a href="http://download.redis.io/releases/redis-4.0.9.tar.gz" target="_blank">http://download.redis.io/releases/redis-4.0.9.tar.gz</a></p>
</blockquote>
<p><img src="../assets/&#x4E0B;&#x8F7D;redis.png" alt=""></p>
</li>
<li><p>step2:&#x89E3;&#x538B;</p>
<blockquote>
<p>tar xzf redis-4.0.9.tar.gz</p>
</blockquote>
</li>
<li><p>step3:&#x79FB;&#x52A8;&#xFF0C;&#x653E;&#x5230;usr/local&#x2F6C;&#x5F55;&#x4E0B;</p>
<blockquote>
<p>sudo mv ./redis-4.0.9 /usr/local/redis/</p>
</blockquote>
</li>
<li><p>step4:&#x8FDB;&#x2F0A;redis&#x2F6C;&#x5F55;</p>
<blockquote>
<p>cd /usr/local/redis/</p>
</blockquote>
</li>
<li><p>step5:&#x751F;&#x6210;</p>
<blockquote>
<p>sudo make</p>
</blockquote>
<p><img src="../assets/redismake.png" alt=""></p>
</li>
<li><p>step6:&#x6D4B;&#x8BD5;,&#x8FD9;&#x6BB5;&#x8FD0;&#x2F8F;&#x65F6;&#x95F4;&#x4F1A;&#x8F83;&#x2ED3;</p>
<blockquote>
<p>sudo make test</p>
</blockquote>
<p><img src="../assets/maketest.png" alt=""></p>
</li>
<li><p>step7:&#x5B89;&#x88C5;,&#x5C06;redis&#x7684;&#x547D;&#x4EE4;&#x5B89;&#x88C5;&#x5230;/usr/local/bin/&#x2F6C;&#x5F55;</p>
<blockquote>
<p>sudo make install</p>
</blockquote>
</li>
<li><p>step8:&#x5B89;&#x88C5;&#x5B8C;&#x6210;&#x540E;&#xFF0C;&#x6211;&#x4EEC;&#x8FDB;&#x5165;&#x76EE;&#x5F55;/usr/local/bin&#x4E2D;&#x67E5;&#x770B;</p>
<blockquote>
<p>cd /usr/local/bin<br>ls -all</p>
</blockquote>
<p><img src="../assets/p1_12.png" alt=""></p>
<blockquote>
<ul>
<li>redis-server redis&#x670D;&#x52A1;&#x5668;</li>
<li>redis-cli redis&#x547D;&#x4EE4;&#x884C;&#x5BA2;&#x6237;&#x7AEF;</li>
<li>redis-benchmark redis&#x6027;&#x80FD;&#x6D4B;&#x8BD5;&#x5DE5;&#x5177;</li>
<li>redis-check-aof AOF&#x6587;&#x4EF6;&#x4FEE;&#x590D;&#x5DE5;&#x5177;</li>
<li>redis-check-rdb RDB&#x6587;&#x4EF6;&#x68C0;&#x7D22;&#x5DE5;&#x5177;</li>
</ul>
</blockquote>
</li>
<li><p>step9:&#x914D;&#x7F6E;&#x2F42;&#x4EF6;&#xFF0C;&#x79FB;&#x52A8;&#x5230;/etc/&#x2F6C;&#x5F55;&#x4E0B;</p>
</li>
<li><p>&#x914D;&#x7F6E;&#x2F42;&#x4EF6;&#x2F6C;&#x5F55;&#x4E3A;/usr/local/redis/redis.conf</p>
<blockquote>
<p>sudo cp /usr/local/redis/redis.conf /etc/redis/</p>
</blockquote>
</li>
<li><p>Mac &#x4E0A;&#x5B89;&#x88C5; Redis: </p>
<ul>
<li>&#x5B89;&#x88C5; Homebrew&#xFF1A;</li>
</ul>
<blockquote>
<p><a href="https://brew.sh/" target="_blank">https://brew.sh/</a></p>
</blockquote>
<ul>
<li>&#x4F7F;&#x7528; brew &#x5B89;&#x88C5; Redis</li>
</ul>
<blockquote>
<p><a href="https://www.cnblogs.com/cloudshadow/p/mac_brew_install_redis.html" target="_blank">https://www.cnblogs.com/cloudshadow/p/mac_brew_install_redis.html</a></p>
</blockquote>
</li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../redis.html" class="navigation navigation-prev " aria-label="Previous page: Redis"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../redis/pei-zhi.html" class="navigation navigation-next " aria-label="Next page: 配置"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
